package cn.lasse.springframework.event;

import cn.hutool.core.date.DateUtil;
import cn.lasse.springframework.context.event.ApplicationListener;

import java.util.Date;

public class CustomEventListener implements ApplicationListener<CustomEvent> {

    @Override
    public void onApplicationEvent(CustomEvent event) {
        System.out.println("收到：" + event.getSource() + "消息;时间：" + DateUtil.formatDateTime(new Date()));
        System.out.println("消息：" + event.getId() + ":" + event.getMessage());
    }

}
